﻿
namespace StatePattern;

internal class LightRed : LightBase
{
    public override void Show()
    {
        Console.WriteLine("红灯停");
    }

    /// <summary>
    /// 变颜色不对，这个类本来就是红灯，颜色变为绿色挺怪异的
    /// </summary>
    public override void Turn()
    {
        LightColor = LightColor.Green;
    }

    /// <summary>
    /// 变颜色改为变灯 就合理多了
    /// </summary>
    /// <param name="context"></param>
    public override void TurnContext(Context context)
    {
        context.CurrentLight = new LightGreen();
    }
}
